import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: yang
 * Date: 2022-04-28
 * Time: 19:05
 */
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int ans=0;
        for (int i = 1; i <= num; i++) {
            int tmp=i;
            int fac=1;
            while (tmp != 0){
                fac *= tmp;
                tmp--;
            }
            ans += fac;
        }
        System.out.println(ans);
    }
}
